<?php
namespace User\Controller;
use Common\Controller\MemberbaseController;
class YhjController extends MemberbaseController {
	
	
	protected $db;
	function _initialize(){
		parent::_initialize();
		$this->db=M("Yhj");
	}

	
	function index(){


		$this->assign ( "nav", "hongbao" );

			$map [uid] = $this->u[id];





			$list = $this->db->where ( $map )->order ("id desc" )->select ();



		foreach($list as $k=>$v){



			if($v["is_use"]==1){

				$list[$k][status]=-1;
				$list[$k][css]="yishiyong";

			}
			elseif($v["youxiao"]<date("Y-m-d")){
				$list[$k][status]=-2;
				$list[$k][css]="guoqi";
			}
			else{
				$list[$k][status]=1;

			}


		}


		     $this->assign("_list",$list);

		$this->assign ( "seo_title",  "我的红包" );
			$this->display ();








	}

}